<template>
	<div id="film_info">

		<div class="film_viem">
			<div class="viem_img">
				<img :src="all_img.cover.origin" />
			</div>
			<div class="viem_info">
				<div class="film_dec">
					<p>影片简介</p>
				</div>
				<div class="for_film">
					<span class="span">导&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;演</span>:<span>{{all_img.director}}</span>
				</div>
				<div class="for_film">
					<span class="span">主&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;演</span>:<span v-for="item in all_img.actors" class="actors">
						{{item.name}}
					</span>
				</div>
				<div class="for_film">
					<span>地区语言：</span>
					<span>{{all_img.nation}}({{all_img.language}})</span>
				</div>
				<div class="for_film">
					<span class="span">类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型</span>:
					<span>{{all_img.nation}}({{all_img.category}})</span>
				</div>
				<div class="for_film">
					<span>上映时间：</span>
					<span>{{format(all_img.premiereAt)}}上映</span>
				</div>
				<div class="introduce">
					<span>
							{{all_img.synopsis}}
				 	</span>
				</div>
				<div class="btn" v-if="all_img.isComingSoon==''">
					<button>立即购票</button>
				</div>
			</div>
		</div>

	</div>
</template>

<script>
	import axios from "axios";
	export default {
		created: function() {
			var that = this;
			var id = this.$route.query.my_id;
			axios.get('http://m.maizuo.com/v4/api/film/' + id)
				.then(function(res) {
					that.all_img = res.data.data.film;
					that.$store.commit("toggleTitle",that.all_img.name)
				})
				.catch(function(error) {
					console.log(error);
				});
		},
		data: function() {
			return {
				all_img: ""
			}
		},
		methods: {
			format: function(time) {
				var time = new Date(time);
				return(time.getMonth() + 1) + "月" + time.getDate() + "日";
			}
		}
	}
</script>

<style lang="scss">
	@import "../scss/film_info.scss";
</style>
